import request from '@/utils/request'
import Cookies from 'js-cookie'

// 获取列表
export function getList(data,page) {
    return request({
        url: '/Ims_send_orders/purchase_send_package_list/'+(page?page:1),
        method: 'post',
        data: data
    })
}
// 列表分页
export function getPage(data) {
    return request({
        url: '/Ims_send_orders/purchase_send_package_page',
        method: 'post',
        data: data
    })
}
// 获取供应商名称
export function getSupplier(data) {
    return request({
        url: '/Ims_supplier/get_supplier',
        method: 'post',
        data: data
    })
}
// 获取仓库名称
export function getHouse(data) {
    return request({
        url: '/General/get_house',
        method: 'post',
        data: data
    })
}
// 发货单下载
export function getExport(data) {
    // window.location.href = `http://dev.hahaipi.com/smsi/index.php/Ims_send_orders/package_print?package_id=${data.package_id}&didixueshengka=${Cookies.get('SMS_AdminToken')}`; 
    window.location.href = `https://${location.host}/smsi/index.php/Ims_send_orders/package_print?package_id=${data.package_id}}&didixueshengka=${Cookies.get('SMS_AdminToken')}`; 
}